<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>服务器连接测试</title>
    <style>
        body {
            font-family: 'Microsoft YaHei', sans-serif;
            max-width: 600px;
            margin: 50px auto;
            padding: 20px;
            text-align: center;
            background-color: #f5f7fa;
        }
        .container {
            background: white;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        h1 {
            color: #4285f4;
            margin-bottom: 20px;
        }
        .url {
            background: #f1f3f4;
            padding: 15px;
            border-radius: 5px;
            margin: 20px 0;
            word-break: break-all;
            font-family: monospace;
        }
        .btn {
            background: #4285f4;
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            margin: 10px;
        }
        .btn:hover {
            background: #3367d6;
        }
        .result {
            margin-top: 20px;
            padding: 15px;
            border-radius: 5px;
            display: none;
        }
        .success {
            background: #e6f4ea;
            color: #137333;
            border: 1px solid #137333;
        }
        .error {
            background: #fce8e6;
            color: #c5221f;
            border: 1px solid #c5221f;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>服务器连接测试用途测试测试</h1>
        <p>测试以下URL是否可以访问：</p>
        <div class="url" id="test-url">http://101.126.43.189:8080/html/MultiArray.html</div>
        
        <button class="btn" onclick="testConnection()">测试连接</button>
        
        <div class="result" id="result"></div>
    </div>

    <script>
        function testConnection() {
            const url = document.getElementById('test-url').textContent;
            const resultDiv = document.getElementById('result');
            
            resultDiv.style.display = 'block';
            resultDiv.className = 'result';
            resultDiv.textContent = '测试中...';
            
            fetch(url, { method: 'HEAD' })
                .then(response => {
                    if (response.ok) {
                        resultDiv.textContent = '✅ 连接成功！服务器响应正常。';
                        resultDiv.className = 'result success';
                    } else {
                        resultDiv.textContent = '❌ 连接失败。服务器返回状态: ' + response.status;
                        resultDiv.className = 'result error';
                    }
                })
                .catch(error => {
                    resultDiv.textContent = '❌ 连接失败: ' + error.message;
                    resultDiv.className = 'result error';
                });
        }
    </script>
</body>
</html>